<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="managesystem.Student" %>
<%@ page import="controlsystem.Course" %>
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.Iterator" %>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"></script>
<script type="text/javascript" src="../scripts/jquery.wizard-tabs-0.1.min.js"></script>
<script type="text/javascript" src="../scripts/timer.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/base/jquery-ui.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js" type="text/javascript"></script>
<%
	Student currStud = (Student) session.getAttribute("currStud");
	Collection<Course> studCourses = currStud.getCourses();
	
%>		
				
          <form action="/trackSchool" method="post" id="form" name="form">
            <div id="tabs">
              <ul>

                <li><a href="#tabs-1">Course selection</a></li>
                <li><a href="#tabs-2">Timer</a></li>
                <li><a href="#tabs-3">Statistics</a></li>
              
              </ul>
  
              <div id="tabs-1">
                <p>Choose your course to track :</p>
                <select name="course">
  
                <% 
		    	for (Iterator<Course> iter = studCourses.iterator(); iter.hasNext();) {
		    		   Course c = (Course) iter.next();
		    		  %>
		    		  	<option value=<%=c.getName()%>><%=c.getName() %></option>
		    		  <%
		    		}
		    	%>
		    	</select>
              </div>
              
              <div id="tabs-2">
                <p>Use this timer to track your studytime :</p>
                <br>
                Time: <input type=text name="timetextarea" value="00:00" size="10" style = "font-size:20px">
                	  <input type="hidden" name="seconds">
						<br>
						<br>
						<input type=button name="start" value="Start" onclick="Start()"> 
						<input type=button name="stop" value="Stop" onclick="Stop()"> 
						<input type=button name="reset" value="Reset" onclick="Reset()">
              </div>
              
              <div id="tabs-3">
                <p>Complete this form to track your study experience :</p><br>
                
                <label>Place :</label>
                <input type="text" name="place"/><br>
                <label>Pages :</label>
                 <input type="text" name="pages"/><br>
                <label>Type (Lesson, Exercises, selfstudy) :</label>
	                <select name="type">
	                	<option value="lesson">Lesson</option>
	                	<option value="exercise">Exercise</option>
	                	<option value="self"> Selfstudy </option>
	                </select> <br>
	                
	            <label>Rating :</label>
		            <select name="rating">
		                	<option value="1">Bad</option>
		                	<option value="2">Rather ok</option>
		                	<option value="3">Normal </option>
		                	<option value="4">Good </option>
		                	<option value="5">Really good!</option>
		            </select> <br>
		        <label>What did you do :</label><br><textarea name="description" COLS=30 ROWS=5></textarea><br>
		        <label>Comment :</label><br><textarea name="comment" COLS=30 ROWS=5></textarea><br>
              </div>
              
            </div>
            
          </form>
	
			<script>
            $(function() {
              $("#tabs").wizardTabs({
                submitAction: function(){
                                $("#form").submit();
                              }
              });
            });
          </script>
 
	
			

